package br.com.webhomesites.padrao.view;

import br.com.webhomesites.configuracao.model.CidadeModel;
import br.com.webhomesites.configuracao.model.EstadoModel;
import br.com.webhomesites.configuracao.utils.ConfiguracaoInstancias;
import br.com.webhomesites.padrao.contracts.IFuncionarioView;
import br.com.webhomesites.padrao.contracts.IDocument;
import java.awt.Component;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import java.awt.event.KeyListener;
import java.util.List;
import javax.swing.JComboBox;
import javax.swing.JTextField;

public class FuncionarioView extends javax.swing.JInternalFrame implements IFuncionarioView {

    //construtor da classe. carrega os componentes
    private IDocument doc;

    public FuncionarioView() {
        initComponents();
        setLocation(50, 10);
        
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        rgFuncionarioPessoa = new javax.swing.ButtonGroup();
        painelCentralFuncionario = new javax.swing.JPanel();
        labelFuncionarioRazaoSocial = new javax.swing.JLabel();
        txtFuncionarioNome = new javax.swing.JTextField();
        labelFuncionarioCodigo = new javax.swing.JLabel();
        txtFuncionarioCodigo = new javax.swing.JTextField();
        labelFuncionarioNome = new javax.swing.JLabel();
        txtFuncionarioRazaoSocial = new javax.swing.JTextField();
        labelFuncionarioBairro = new javax.swing.JLabel();
        labelFuncionarioEstado = new javax.swing.JLabel();
        txtFuncionarioEndereco = new javax.swing.JTextField();
        txtFuncionarioTelefone = new javax.swing.JTextField();
        txtFuncionarioBairro = new javax.swing.JTextField();
        comboFuncionarioEstado = new javax.swing.JComboBox();
        comboFuncionarioCidade = new javax.swing.JComboBox();
        labelFuncionarioTelefone = new javax.swing.JLabel();
        labelFuncionarioEmail = new javax.swing.JLabel();
        labelFuncionarioCidade = new javax.swing.JLabel();
        txtFuncionarioEmail = new javax.swing.JTextField();
        labelFuncionarioEndereco = new javax.swing.JLabel();
        labeFuncionarioCpf = new javax.swing.JLabel();
        txtFuncionarioCpf = new javax.swing.JTextField();
        labelFuncionarioRg = new javax.swing.JLabel();
        txtFuncionarioRg = new javax.swing.JTextField();
        txtFuncionarioCelular = new javax.swing.JTextField();
        labelFuncionarioCelular = new javax.swing.JLabel();
        txtFuncionarioContato = new javax.swing.JTextField();
        labelFuncionarioContato = new javax.swing.JLabel();
        labelFuncionarioObservacao = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        areaFuncionarioObservacao = new javax.swing.JTextArea();
        labelFuncionarioObservacao1 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        areaFuncionarioObservacao1 = new javax.swing.JTextArea();
        btnNovo = new javax.swing.JButton();
        btnRemover = new javax.swing.JButton();
        btnSalvar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        btnPesquisar = new javax.swing.JButton();
        btnEditar = new javax.swing.JButton();

        setClosable(true);
        setIconifiable(true);

        painelCentralFuncionario.setBorder(javax.swing.BorderFactory.createTitledBorder("Cadastro de Funcionário"));
        painelCentralFuncionario.setPreferredSize(new java.awt.Dimension(486, 440));

        labelFuncionarioRazaoSocial.setText("Cargo");

        txtFuncionarioNome.setColumns(5);
        txtFuncionarioNome.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        txtFuncionarioNome.setCaretPosition(0);

        labelFuncionarioCodigo.setText("Cód.Func.");

        labelFuncionarioNome.setText("Nome");

        labelFuncionarioBairro.setText("Bairro");

        labelFuncionarioEstado.setText("Estado");

        labelFuncionarioTelefone.setText("Telefone");

        labelFuncionarioEmail.setText("E-mail");

        labelFuncionarioCidade.setText("Cidade");

        labelFuncionarioEndereco.setText("Endereço");

        labeFuncionarioCpf.setText("CPF");

        labelFuncionarioRg.setText("RG");

        labelFuncionarioCelular.setText("Celular");

        labelFuncionarioContato.setText("Contato");

        labelFuncionarioObservacao.setText("Observações");

        areaFuncionarioObservacao.setColumns(20);
        areaFuncionarioObservacao.setRows(5);
        jScrollPane1.setViewportView(areaFuncionarioObservacao);

        labelFuncionarioObservacao1.setText("Salário");

        areaFuncionarioObservacao1.setColumns(20);
        areaFuncionarioObservacao1.setRows(5);
        jScrollPane2.setViewportView(areaFuncionarioObservacao1);

        javax.swing.GroupLayout painelCentralFuncionarioLayout = new javax.swing.GroupLayout(painelCentralFuncionario);
        painelCentralFuncionario.setLayout(painelCentralFuncionarioLayout);
        painelCentralFuncionarioLayout.setHorizontalGroup(
            painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelCentralFuncionarioLayout.createSequentialGroup()
                        .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtFuncionarioNome)
                                    .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                                        .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                                                    .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(txtFuncionarioTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(labelFuncionarioTelefone))
                                                    .addGap(14, 14, 14)
                                                    .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(labelFuncionarioCelular)
                                                        .addComponent(txtFuncionarioCelular)))
                                                .addComponent(labelFuncionarioRg)
                                                .addComponent(labelFuncionarioCodigo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(labelFuncionarioNome)
                                                .addComponent(txtFuncionarioRg, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addComponent(txtFuncionarioCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(txtFuncionarioCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(labelFuncionarioEndereco)
                                            .addComponent(labelFuncionarioEstado)
                                            .addComponent(labelFuncionarioCidade))
                                        .addGap(0, 61, Short.MAX_VALUE)))
                                .addGap(0, 18, 18))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelCentralFuncionarioLayout.createSequentialGroup()
                                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(comboFuncionarioCidade, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(comboFuncionarioEstado, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addGap(18, 18, 18))
                            .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                                .addComponent(labeFuncionarioCpf)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelFuncionarioEmail)
                            .addComponent(labelFuncionarioRazaoSocial)
                            .addComponent(labelFuncionarioContato)
                            .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(labelFuncionarioObservacao1)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(labelFuncionarioBairro)
                                    .addComponent(txtFuncionarioEmail, javax.swing.GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
                                    .addComponent(txtFuncionarioBairro)
                                    .addComponent(txtFuncionarioRazaoSocial)))
                            .addComponent(labelFuncionarioObservacao)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtFuncionarioContato, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(40, 40, 40))
                    .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                        .addComponent(txtFuncionarioEndereco)
                        .addGap(363, 363, 363))))
        );
        painelCentralFuncionarioLayout.setVerticalGroup(
            painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelFuncionarioCodigo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtFuncionarioCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFuncionarioNome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(labelFuncionarioRazaoSocial, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtFuncionarioNome)
                    .addComponent(txtFuncionarioRazaoSocial))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFuncionarioObservacao1)
                    .addComponent(labeFuncionarioCpf, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(painelCentralFuncionarioLayout.createSequentialGroup()
                        .addComponent(txtFuncionarioCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(labelFuncionarioRg)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtFuncionarioRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addGap(18, 51, Short.MAX_VALUE)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFuncionarioTelefone)
                    .addComponent(labelFuncionarioEmail)
                    .addComponent(labelFuncionarioCelular))
                .addGap(7, 7, 7)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtFuncionarioTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtFuncionarioEmail)
                    .addComponent(txtFuncionarioCelular))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFuncionarioEndereco)
                    .addComponent(labelFuncionarioBairro))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtFuncionarioEndereco)
                    .addComponent(txtFuncionarioBairro))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFuncionarioEstado)
                    .addComponent(labelFuncionarioContato))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboFuncionarioEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtFuncionarioContato, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFuncionarioCidade)
                    .addComponent(labelFuncionarioObservacao))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(painelCentralFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(comboFuncionarioCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32))
        );

        btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/document-icon.png"))); // NOI18N
        btnNovo.setMnemonic('n');

        btnRemover.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete-icon.png"))); // NOI18N
        btnRemover.setMnemonic('x');

        btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save-icon.png"))); // NOI18N
        btnSalvar.setMnemonic('s');

        btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/block-icon.png"))); // NOI18N
        btnCancelar.setMnemonic('c');

        btnPesquisar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/search-icon.png"))); // NOI18N
        btnPesquisar.setMnemonic('p');

        btnEditar.setText("Editar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnNovo, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnRemover, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(painelCentralFuncionario, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 671, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addComponent(painelCentralFuncionario, javax.swing.GroupLayout.DEFAULT_SIZE, 546, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(btnSalvar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnRemover, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnCancelar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnEditar, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(btnPesquisar, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtFornecedorRazaoSocialActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFornecedorRazaoSocialActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtFornecedorRazaoSocialActionPerformed

    private void txtFornecedorEnderecoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFornecedorEnderecoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtFornecedorEnderecoActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea areaFuncionarioObservacao;
    private javax.swing.JTextArea areaFuncionarioObservacao1;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnEditar;
    private javax.swing.JButton btnNovo;
    private javax.swing.JButton btnPesquisar;
    private javax.swing.JButton btnRemover;
    private javax.swing.JButton btnSalvar;
    private javax.swing.JComboBox comboFuncionarioCidade;
    private javax.swing.JComboBox comboFuncionarioEstado;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JLabel labeFuncionarioCpf;
    private javax.swing.JLabel labelFuncionarioBairro;
    private javax.swing.JLabel labelFuncionarioCelular;
    private javax.swing.JLabel labelFuncionarioCidade;
    private javax.swing.JLabel labelFuncionarioCodigo;
    private javax.swing.JLabel labelFuncionarioContato;
    private javax.swing.JLabel labelFuncionarioEmail;
    private javax.swing.JLabel labelFuncionarioEndereco;
    private javax.swing.JLabel labelFuncionarioEstado;
    private javax.swing.JLabel labelFuncionarioNome;
    private javax.swing.JLabel labelFuncionarioObservacao;
    private javax.swing.JLabel labelFuncionarioObservacao1;
    private javax.swing.JLabel labelFuncionarioRazaoSocial;
    private javax.swing.JLabel labelFuncionarioRg;
    private javax.swing.JLabel labelFuncionarioTelefone;
    private javax.swing.JPanel painelCentralFuncionario;
    private javax.swing.ButtonGroup rgFuncionarioPessoa;
    private javax.swing.JTextField txtFuncionarioBairro;
    private javax.swing.JTextField txtFuncionarioCelular;
    private javax.swing.JTextField txtFuncionarioCodigo;
    private javax.swing.JTextField txtFuncionarioContato;
    private javax.swing.JTextField txtFuncionarioCpf;
    private javax.swing.JTextField txtFuncionarioEmail;
    private javax.swing.JTextField txtFuncionarioEndereco;
    private javax.swing.JTextField txtFuncionarioNome;
    private javax.swing.JTextField txtFuncionarioRazaoSocial;
    private javax.swing.JTextField txtFuncionarioRg;
    private javax.swing.JTextField txtFuncionarioTelefone;
    // End of variables declaration//GEN-END:variables

    @Override
    public void setCodigo(long codigo) {
        this.txtFuncionarioCodigo.setText((Long.toString(codigo)));
    }

    @Override
    public long getCodigo() {
        return Long.parseLong(txtFuncionarioCodigo.getText());
    }
   
    @Override
    public void setNome(String nome) {
        this.txtFuncionarioNome.setText(nome);
    }

    @Override
    public String getNome() {
        return this.txtFuncionarioNome.getText();
    }

    @Override
    public void setCpf(String cpf) {
        this.txtFuncionarioCpf.setText(cpf);
    }

    @Override
    public String getCpf() {
        return this.txtFuncionarioCpf.getText();
    }

    @Override
    public void setRg(String rg) {
        this.txtFuncionarioRg.setText(rg);
    }

    @Override
    public String getRg() {
        return this.txtFuncionarioRg.getText();
    }

    @Override
    public void setCelular(String celular) {
        this.txtFuncionarioCelular.setText(celular);
    }

    @Override
    public String getCelular() {
        return this.txtFuncionarioCelular.getText();
    }

    @Override
    public void setEndereco(String endereco) {
        this.txtFuncionarioEndereco.setText(endereco);
    }

    @Override
    public String getEndereco() {
        return txtFuncionarioEndereco.getText();
    }

    @Override
    public void setBairro(String bairro) {
        this.txtFuncionarioBairro.setText(bairro);
    }

    @Override
    public String getBairro() {
        return txtFuncionarioBairro.getText();
    }

    @Override
    public void setListaCidade(List<CidadeModel> listaCidades) {
        comboFuncionarioCidade.removeAllItems();
        for (int i = 0; i < listaCidades.size(); i++) // Percorro o Array List com o For aprimorado.  
        {
            this.comboFuncionarioCidade.addItem(listaCidades.get(i).getNome()); // Adiciono os dados.  
        }
    }

    @Override
    public String getCidade() {
        return comboFuncionarioCidade.getSelectedItem().toString();
    }

    @Override
    public void setListaEstado(List<EstadoModel> listaEstados) {

        for (int i = 0; i < listaEstados.size(); i++) // Percorro o Array List com o For aprimorado.  
        {
            this.comboFuncionarioEstado.addItem(listaEstados.get(i).getNome()); // Adiciono os dados.  
        }
    }

    @Override
    public String getEstado() {
        return comboFuncionarioEstado.getSelectedItem().toString();
    }

    @Override
    public void setTelefone(String telefone) {
        this.txtFuncionarioTelefone.setText(telefone);
    }

    @Override
    public String getTelefone() {
        return txtFuncionarioTelefone.getText();
    }

    @Override
    public void setEmail(String email) {
        this.txtFuncionarioEmail.setText(email);
    }

    @Override
    public String getEmail() {
        return txtFuncionarioEmail.getText();
    }
    
    @Override
    public void setContato(String contato) {
        this.txtFuncionarioContato.setText(contato);
    }

    @Override
    public String getContato() {
        return txtFuncionarioContato.getText();
    }

    @Override
    public void setObservacao(String observacao) {
        this.areaFuncionarioObservacao.setText(observacao);
    }

    @Override
    public String getObservacao() {
        return areaFuncionarioObservacao.getText();
    }
    
    
    @Override
    public void packAndShow() {
        //this.pack();  
        ConfiguracaoInstancias.getDesktopColeta().getDesktop().add(this);
        //txtFuncionarioCodigo.setMaximumSize(4);
        //StrategyDocument.DocLetras;        
        //txtFuncionarioBairro.setDocument(new StrategyDocument.DocLetras().getDocumentoPlano());
        //txtFuncionarioNome.setDocument(new StrategyDocument.DocLetras().getDocumentoPlano());
        //txtFuncionarioRazaoSocial.setDocument(new StrategyDocument.DocLetras().getDocumentoPlano());
        //txtFuncionarioNome.setDocument(new StrategyDocument.DocLetras().getDocumentoPlano());
        //txtFuncionarioEndereco.setDocument(new StrategyDocument.DocEndereco().getDocumentoPlano());
        this.setVisible(true);
    }

    @Override
    public void clearFields() {
        Component[] componentesPainel;
        componentesPainel = painelCentralFuncionario.getComponents();
        for (int j = 0; j < componentesPainel.length; j++) {
            if (componentesPainel[j] instanceof JTextField) {
                JTextField field = (JTextField) componentesPainel[j];
                field.setText("");
            }
        }
    }

    @Override
    public void putNull() {
        txtFuncionarioBairro = null;
        txtFuncionarioEndereco = null;
        txtFuncionarioNome = null;
        txtFuncionarioRazaoSocial = null;
    }

    @Override
    public void enableTxtFuncionarioCodigo(boolean arg) {
        txtFuncionarioCodigo.setEnabled(arg);
    }

    @Override
    public void enableRgFuncionarioPessoa(boolean arg) {
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void enableTxtFuncionarioNome(boolean arg) {
        this.txtFuncionarioNome.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioCpf(boolean arg) {
        this.txtFuncionarioCpf.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioRg(boolean arg) {
        this.txtFuncionarioRg.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioCelular(boolean arg) {
        this.txtFuncionarioCelular.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioEndereco(boolean arg) {
        txtFuncionarioEndereco.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioBairro(boolean arg) {
        txtFuncionarioBairro.setEnabled(arg);
    }

    @Override
    public void enableComboFuncionarioCidade(boolean arg) {
        comboFuncionarioCidade.setEnabled(arg);
    }

    @Override
    public void enableComboFuncionarioEstado(boolean arg) {
        comboFuncionarioEstado.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioTelefone(boolean arg) {
        txtFuncionarioTelefone.setEnabled(arg);
    }

    @Override
    public void enableTxtFuncionarioEmail(boolean arg) {
        txtFuncionarioEmail.setEnabled(arg);
    }

    @Override
    public void enableBtnAlterar(boolean arg) {
        this.btnEditar.setEnabled(arg);
    }

    @Override
    public void enableBtnRemover(boolean arg) {
        this.btnRemover.setEnabled(arg);
    }

    @Override
    public void enableBtnCancelar(boolean arg) {
        this.btnCancelar.setEnabled(arg);
    }

    @Override
    public void enableBtnSalvar(boolean arg) {
        this.btnSalvar.setEnabled(arg);
    }

    @Override
    public void enableBtnInserir(boolean arg) {
        this.btnNovo.setEnabled(arg);
    }

    @Override
    public void setInserirActionListener(ActionListener listener) {
        this.btnNovo.addActionListener(listener);
    }

    @Override
    public void setRemoverActionListener(ActionListener listener) {
        this.btnRemover.addActionListener(listener);
    }

    @Override
    public void setAlterarActionListener(ActionListener listener) {
        this.btnEditar.addActionListener(listener);
    }

    @Override
    public void setCancelarActionListener(ActionListener listener) {
        this.btnCancelar.addActionListener(listener);
    }

    @Override
    public void setSalvarActionListener(ActionListener listener) {
        this.btnSalvar.addActionListener(listener);
    }

    @Override
    public void setBtnSairActionListener(ActionListener listener) {
        //this.btnSair.addActionListener(listener); 
    }

    public void setBuscaAvancadaActionListener(ActionListener listener) {
        this.btnPesquisar.addActionListener(listener);
    }

    @Override
    public void removeAllitensComboFuncionarioCidade() {
        this.comboFuncionarioCidade.removeAllItems();
    }

    @Override
    public void removeAllitensComboFuncionarioEstado() {
        this.comboFuncionarioEstado.removeAllItems();
    }

    @Override
    public void setMascaraListener(KeyListener listener) {
        
        this.txtFuncionarioCpf.addKeyListener(listener);
        //this.txtFuncionarioRg.addKeyListener(listener);
        this.txtFuncionarioTelefone.addKeyListener(listener);
        this.txtFuncionarioCelular.addKeyListener(listener);
    }

    
    public JComboBox getComboEstadoJCombo() {
        return comboFuncionarioEstado;
    }

    @Override
    public void setComboEstadoActionListener(ItemListener listener) {
        this.comboFuncionarioEstado.addItemListener(listener);
    }

    @Override
    public void setCidade(String cidade) {
        this.comboFuncionarioCidade.setSelectedItem(cidade);
    }

    @Override
    public void setEstado(String estado) {
        this.comboFuncionarioEstado.setSelectedItem(estado);
    }
    
}
